/**
 * 
 */
package vue.globalBar;

import java.awt.Dimension;
import java.awt.GridLayout;

import javax.swing.BoxLayout;

import vue.session.IGCNFUse;
import vue.session.IGExecutionBlock;
import vue.session.IGPreprocessorBlock;
import vue.session.IGSolverBlock;
import controller.ISessionManager;

/**
 * @author GRONOWSKI Stephane svan001@aol.com
 * 
 *         igsat 2010
 * 
 */
public class IGCNFExecutionBar extends IGGlobalExecutionBar {

	private static final long	serialVersionUID	= 1L;

	public static final String	BORDER_TITLE		= "CNF Execution Bar";

	public static final int		HEIGHT				= 100;
	public static final int		WIDTH				= 1200;

	private IGCNFUse			cnf;


	public IGCNFExecutionBar(IGCNFUse cnf, ISessionManager manager) {
		super(manager);

		this.cnf = cnf;


		setLayout(new GridLayout(1, 2));
		// runningPanel.setLayout(new GridLayout(1, 0));
		// donePanel.setLayout(new GridLayout(1, 0));
		runningPanel.setLayout(new BoxLayout(runningPanel, BoxLayout.X_AXIS));
		donePanel.setLayout(new BoxLayout(donePanel, BoxLayout.X_AXIS));

		dim = new Dimension(WIDTH, HEIGHT);

		// setBorder(BorderFactory.createTitledBorder(BORDER_TITLE));
		setBorder(null);

		setPreferredSize(dim);
		setSize(dim);
	}


	@Override
	public void addExecution(IGCNFUse cnfuse, IGExecutionBlock exec) {
		if (cnfuse == cnf)
			super.addExecution(cnfuse, exec);
	}


	@Override
	public void addPreprocessor(IGCNFUse cnfuse, IGPreprocessorBlock preproc, IGCNFUse res) {
		if (cnfuse == cnf)
			super.addPreprocessor(cnfuse, preproc, res);
	}


	@Override
	public void addSolver(IGCNFUse cnfuse, IGSolverBlock solver) {
		if (cnfuse == cnf)
			super.addSolver(cnfuse, solver);
	}

}
